<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>

</head>
<body>
<script type="text/javascript">
    // var stus=[{id:1,name:"zs",age:20},{id:2,name:"ss",age:21},{id:3,name:"ww",age:23}]
    // stus.forEach((stu,index)=>{
    //     console.log(stu);
    // });
    // var totalAge=stus.reduce((total,stu)=>{return total+=stu.age},0);
    // console.log(totalAge);
    // var newStus=stus.filter((stu,index)=>{return stu.id!=2});
    // console.log(newStus);
    // var newStu=stus.map((stu,index)=>{stu.age++;return stu;});
    // console.log(newStu);
    var ids=[1,2,3];
    var newArr=ids.map((value,index)=>{return "ids="+value});
    console.log(newArr);
    var str=newArr.join("&");//把数组里面的元素拼接起来转换为字符串。拼接的时候用参数进行分割
    console.log(str);
</script>
</body>
</html>